package com.njtoyo.taxi.admin.mapper.master.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njtoyo.taxi.admin.library.Const;
import com.njtoyo.taxi.admin.mapper.master.entity.ActivityRewardLog;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;

@Repository
@DS(Const.PRIMARY_DS)
public interface ActivityRewardLogMapper extends BaseMapper<ActivityRewardLog> {
    /**
     * 获取某个用户或司机某类活动奖励总额
     *
     * @param category 1:乘客奖励 2:司机奖励
     * @param ruleId   活动ID
     * @return
     */
    BigDecimal grantAmountBy(@Param("ruleId") Long ruleId, @Param("category") int category);
}
